<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]-->
<!DOCTYPE html>
<html>

<head>
	<title>数字绘</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
	<link rel="stylesheet" type="text/css" href="/static/editor/styles/grapheditor.css">
	<script type="text/javascript">
		// Parses URL parameters. Supported parameters are:
		// - lang=xy: Specifies the language of the user interface.
		// - touch=1: Enables a touch-style user interface.
		// - storage=local: Enables HTML5 local storage.
		// - chrome=0: Chromeless mode.
		var urlParams = (function (url) {
			var result = new Object();
			var idx = url.lastIndexOf('?');

			if (idx > 0) {
				var params = url.substring(idx + 1).split('&');

				for (var i = 0; i < params.length; i++) {
					idx = params[i].indexOf('=');

					if (idx > 0) {
						result[params[i].substring(0, idx)] = params[i].substring(idx + 1);
					}
				}
			}

			return result;
		})(window.location.href);

		// Default resources are included in grapheditor resources
		mxLoadResources = false;
	</script>
	<script type="text/javascript" src="/static/js/jquery.min.js"></script>
	<script type="text/javascript" src="/static/editor/js/Init.js"></script>
	<script type="text/javascript" src="/static/editor/deflate/pako.min.js"></script>
	<script type="text/javascript" src="/static/editor/deflate/base64.js"></script>
	<script type="text/javascript" src="/static/editor/jscolor/jscolor.js"></script>
	<script type="text/javascript" src="/static/editor/sanitizer/sanitizer.min.js"></script>
	<script type="text/javascript" src="/static/mxgraph/src/js/mxClient.js"></script>
	<script type="text/javascript" src="/static/editor/js/EditorUi.js"></script>
	<script type="text/javascript" src="/static/editor/js/Editor.js"></script>
	<script type="text/javascript" src="/static/editor/js/Sidebar.js"></script>
	<script type="text/javascript" src="/static/editor/js/Graph.js"></script>
	<script type="text/javascript" src="/static/editor/js/Format.js"></script>
	<script type="text/javascript" src="/static/editor/js/Shapes.js"></script>
	<script type="text/javascript" src="/static/editor/js/Actions.js"></script>
	<script type="text/javascript" src="/static/editor/js/Menus.js"></script>
	<script type="text/javascript" src="/static/editor/js/Toolbar.js"></script>
	<script type="text/javascript" src="/static/editor/js/Dialogs.js"></script>
	<!--多个组件-->
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-Advanced.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-AlliedTelesis.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-Android.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-ArchiMate.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-ArchiMate3.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-Arrows2.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-Atlassian.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-AWS.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-AWS3.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-AWS3D.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-AWS4.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-Azure.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-Basic.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-Bootstrap.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-BPMN.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-Cabinet.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-CiscoSafe.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-Citrix.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-DFD.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-EIP.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-Electrical.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-ER.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-Floorplan.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-Flowchart.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-GCP.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-GCP2.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-Gmdl.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-IBM.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-Infographic.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-Ios.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-Ios7.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-LeanMapping.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-Mockup.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-MSCAE.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-Network.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-Office.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-PID.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-Rack.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-Sitemap.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-Sysml.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-Veeam.js"></script>
	<script type="text/javascript" src="/static/editor/js/sidebar/Sidebar-WebIcons.js"></script>
	<script type="text/javascript" src="/static/editor/js/Setting.js"></script>
</head>

<body class="geEditor">
	<script type="text/javascript">
		//上传组件
		uploadConfig = {
			saveType: "{$policyData.policy_type}",
			maxSize: "{$policyData.max_size}mb",
			allowSource: "{$policyData.origin_link}",
			upUrl: window.STORE_IMG_URL,

		};
		$.getScript("/static/js/moxie.js", function () {
			$.getScript("/static/js/plupload.dev.js", function () {
				$.getScript("/static/js/qiniu.js", function () {
					$.getScript("/static/editor/js/uploader.js",function(){
					});
				});
			});
		});
		window.isVip = false;
		// Extends EditorUi to update I/O action states based on availability of backend
		(function () {
			$.post('/Vip/isVip', function (response) {
				window.isVip = response;
			});

			var editorUiInit = EditorUi.prototype.init;

			EditorUi.prototype.init = function () {
				editorUiInit.apply(this, arguments);
				this.actions.get('export').setEnabled(false);

				// Updates action states which require a backend
				if (!Editor.useLocalStorage) {
					mxUtils.post(OPEN_URL, '', mxUtils.bind(this, function (req) {
						var enabled = req.getStatus() != 404;
						this.actions.get('saveAndExit').setEnabled(enabled || Graph.fileSupport);
						this.actions.get('import').setEnabled(enabled || Graph.fileSupport);
						this.actions.get('save').setEnabled(enabled);
						this.actions.get('saveAs').setEnabled(enabled);
						this.actions.get('export').setEnabled(enabled);
					}));
				}
			};

			// Adds required resources (disables loading of fallback properties, this can only
			// be used if we know that all keys are defined in the language specific file)
			mxResources.loadDefaultBundle = false;
			var bundle = mxResources.getDefaultBundle(RESOURCE_BASE, mxLanguage) ||
				mxResources.getSpecialBundle(RESOURCE_BASE, mxLanguage);

			// Fixes possible asynchronous requests
			mxUtils.getAll([bundle, STYLE_PATH + '/default.xml'], function (xhr) {
				// Adds bundle text to resources
				mxResources.parse(xhr[0].getText());

				// Configures the default graph theme
				var themes = new Object();
				themes[Graph.prototype.defaultThemeName] = xhr[1].getDocumentElement();

				// Main
				window.UI = new EditorUi(new Editor(urlParams['chrome'] == '0', themes));
				if (FILE_PATH != '') {
					var filename = FILE_PATH.substring(FILE_PATH.lastIndexOf("/") + 1);
					window.UI.editor.setFilename(filename);
					window.UI.updateDocumentTitle();
					if (TEMPLATE != '') {
						$.get(window.TEMPLATE_URL + '?template_name=' + TEMPLATE, function (response) {
							var doc = mxUtils.parseXml(response.result.template);
							window.UI.editor.setGraphXml(doc.documentElement);
							window.UI.editor.setModified(false);
							window.UI.editor.undoManager.clear();
						});
					}
					else if (SHARE != '') {
						$.get(window.SHARE_URL + '?share_key=' + SHARE, function (response) {
							debugger
							var responseObj = JSON.parse(response);
							var doc = mxUtils.parseXml(responseObj.result);
							window.UI.editor.setGraphXml(doc.documentElement);
							window.UI.editor.setModified(false);
							window.UI.editor.undoManager.clear();
						});
					}
					else
					{
						var data = { 'action': 'getContent', 'item': FILE_PATH }
						$.ajax({
							type: 'POST',
							url: window.CONTENT_URL,
							data: JSON.stringify(data),
							contentType: 'application/json;charset=utf-8',
							dataType: 'json',
							success: function (response) {
								var doc = mxUtils.parseXml(response.result);
								window.UI.editor.setGraphXml(doc.documentElement);
								window.UI.editor.setModified(false);
								window.UI.editor.undoManager.clear();
							},
							error: function (e) {
								console.error(e);
							}
						});
					}
				}
				

			}, function () {
					document.body.innerHTML = '<center style="margin-top:10%;">Error loading resource files. Please check browser console.</center>';
				});
		})();
	</script>
	<div style="display:none">
		<div id="container"></div>
		<div id="pickfiles"></div>
	</div>

</body>

</html>